Fix near-term release dates missing from the macro calendar (weekly limit)#369
Merged
Conversation
build_release_calendar fetched release dates with sort_order=desc + limit=24. desc returns the FURTHEST-future dates first, so for a weekly series (ICSA) with many scheduled future dates the NEAREST ones fell off the bottom — the seeded artifact was missing ~7 weeks of near-term initial-claims dates (started 7/23 instead of 6/5). Monthly series were unaffected. Bump the limit to 130 (covers a year-plus of any cadence); the caller still trims to the 180d horizon. Adds a regression test pinning the limit floor + future-dates flag, since the existing tests mock _fred_release_dates wholesale and can't catch the param. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
The seeded
macro_release_calendar.parquetwas missing ~7 weeks of near-term Initial Claims (ICSA) dates — it started at 7/23 instead of 6/5. Monthly series (CPI/unemployment/sentiment) were fine.Cause
_fred_release_datesqueried FRED withsort_order=desc+limit=24. Desc returns the furthest-future scheduled dates first, so for a weekly series (which has ~52 future scheduled dates) the top-24 are all far-future and the nearest ones fall off the bottom of the limit.Fix
Bump the limit to 130 — comfortably covers a year-plus of any cadence (weekly ≈ 52/yr) so the desc window always reaches today; the caller still trims to the 180-day horizon. Added a regression test pinning
limit >= 120+ theinclude_release_dates_with_no_data/sort_orderparams (the existing tests mock_fred_release_dateswholesale, so they can't catch the query params).Verification
Follows the merged #368.
🤖 Generated with Claude Code